#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##############################################
# @Author: DengLibin 榆霖
# @Date: Create in 2022-03-30 12:15:07
# @Description: 获取数据集
##############################################
from json import load

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split


def dataset_demo():
    """
    sklearn 数据集使用
    """
    
    iris = load_iris()
    print("鸢尾花数据集:\n", iris)
    print("特征值:\n", iris.data, iris.data.shape)
    print("目标值:\n", iris.target) # 0, 1, 2 
    print("特征值名字:\n", iris.feature_names)
    print("目标值名字:\n", iris.target_names)
    print("描述:\n", iris.DESCR)
    # 数据集划分 
    x_train, x_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2, random_state=22)
    
    return None

if __name__ == '__main__':
   dataset_demo()
